const { log, Resp, readDir } = require("../../config/utils");
const { staticPath } = require("../../config/env");
class RoleCtrl {
	// 资源列表
	async list(req, res, next) {
		try {
			const files = await readDir(staticPath);
			return res.send(new Resp(1, "查询资源成功!", files));
		} catch (err) {
			log("red", err.stack);
			return next(new Error("查询资源出错"));
		}
	}
}

module.exports = new RoleCtrl();